﻿using System;
using System.Web;
using Elmah;

namespace BlogLite.Helpers
{
    /// <summary>
    /// 
    /// </summary>
    public static class ErrorSignaler
    {
        // We're doing this so Elmah doesn't have a cow about not having
        // the a context when we test, this also gives us the advantage
        // of not logging errors during testing.
        public static void SignalFromCurrentContext(Exception e)
        {
            if (HttpContext.Current != null)
                ErrorSignal.FromCurrentContext().Raise(e);
        }
    }
}
